<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Progress and To Do</title>
<link rel="shortcut icon" href="<?php echo base_url()?>images/detik.png"/>
<link href="<?php echo base_url()?>css/progress.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.4.min.js"></script> 
<script type="text/javascript" src="<?php echo base_url()?>js/tab.js"></script> 

<body>
<?php
    // efisiensi kodingan, query header di simpan di view
    $query = $this->db->query('select * from todo_personal where ID_USER='.$this->session->userdata('id'))->result_array();
    $count_todo = count($query);
    $query = $this->db->query('SELECT * FROM `todo_divisi` inner join jabatan_divisi on todo_divisi.ID_DIVISI=jabatan_divisi.ID_DIVISI where jabatan_divisi.ID_USER='.$this->session->userdata('id'))->result_array();
    $count_todo += count($query);
    
    $query = $this->db->query('select * from komplain where (ID_DIVISI<>0 and ID_DIVISI<>-1)')->result_array();
    $problem = $query;
    $query = $this->db->query('select * from komentar_sesi where (ID_DIVISI<>0 and ID_DIVISI<>-1)')->result_array();
    for($j=0;$j<count($query);$j++)
        array_push($problem, $query[$j]);

    $count_problem = 0;
    $mydivisi = $this->db->query('select * from jabatan_divisi where ID_USER='.$this->session->userdata('id'))->result_array();
    for($i=0;$i<count($problem);$i++){
        for($j=0;$j<count($mydivisi);$j++){
            if($mydivisi[$j]['ID_DIVISI']==$problem[$i]['ID_DIVISI']){
                $count_problem+=1;
                break;
            }
        }
    }
    ?>
<!---Mulai Menu Samping---->
<div id="lining">
	<div> Hi, <?php echo $this->session->userdata('nama')?> </div>
	<a href="<?php echo base_url()?>progress/progress_con/say_plain">Say Your Progress</a>
	<a href="<?php echo base_url()?>progress/progress_con/todo_making">Make a Todo</a>
	<a href="<?php echo base_url()?>progress/progress_con/complain">Complain</a>
	<a href="<?php echo base_url()?>progress/progress_con/todo_personal_me">Your todo <span class="todoku"><?php echo $count_todo?></span></a>
	<a href="<?php echo base_url()?>progress/progress_con/problem_page/new">Problem <span class="todoku"><?php echo $count_problem?></span></a>
	<a href="<?php echo base_url()?>progress/login_con/logout">Logout</a> 
	<img src="<?php echo $this->session->userdata('foto')?>" />
</div>
<!---Selesai Menu Samping---->

<!---Mulai Header---->
<div id="bungkus"> 
	<div id="bungkus-1"> 
		<img id="wr" src="<?php echo base_url()?>images/detik.png" />
		<div id="rw">
			<div id="run">Progress</div>
			<div id="walk">& Todo</div>
			<div id="walk2">#ComLabsITCourse</div>
		</div>
		<div id="martabak">
			<table border="0" align="right" cellpadding="0" cellspacing="0">
			  <tr>
				<td align="right">        	
				<div id="menuluar">
					<div id="menudalam">
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td class="hihi"><a href="<?php echo base_url().'progress/progress_con/'?>"><img src="<?php echo base_url()?>images/ic_menu_home.png" height="20px" width="20px"/></a></td>
							<td class="hihi"><a href="<?php echo base_url().'progress/progress_con/progress'?>">Progress</a></td>
							<td><a href="<?php echo base_url().'progress/progress_con/todo'?>">Todo</a></td>
						</tr>
					</table>
					</div>
				</div></td>
			  </tr>
			  <tr>
				<td align="right">
					<p id="menukecil">
						<a href="<?php echo base_url().'progress/progress_con/absen'?>">Absen</a> | 
						<a href="#">Statistic</a> | 
						<a href="<?php echo base_url().'progress/progress_con/file'?>">File</a> | 
						<a href="<?php echo base_url().'progress/progress_con/problem'?>">Problem</a>
					</p>
				</td>
			  </tr>
			</table>
		</div>
		<div class="clear"></div>
	</div><!---Selesai div bungkus-1---->
	<div id="bungkus-1x"></div>
	<div id="bungkus-2"> 
	<!---Selesai Header---->
	
        <!--- Mulai Isi --->